#ifndef UTILITY_H
#define UTILITY_H

#include <QString>
class PlaylistEntry;
class QWidget;

namespace TagLib
{
    class String;
}

namespace util
{
void file_append_extension(QString * filePath, QString ext);

// Funzioni di ordinamento
bool fileNameLessThan(const PlaylistEntry*s1, const PlaylistEntry* s2);
bool titleLessThan(const PlaylistEntry* s1, const PlaylistEntry* s2);
bool artistLessThan(const PlaylistEntry* s1, const PlaylistEntry* s2);

bool fileNameGreaterThan(const PlaylistEntry* s1, const PlaylistEntry* s2);
bool titleGreaterThan(const PlaylistEntry* s1, const PlaylistEntry* s2);
bool artistGreaterThan(const PlaylistEntry* s1, const PlaylistEntry* s2);

int  randrange(int);

void set_whole_widget_readonly(QWidget* target, bool readonly);
void tagstring_to_qstring(const TagLib::String* source, QString ifNull, QString* output);

};

#endif // UTILITY_H
